<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Template_name')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-template_name" data-rule="required" class="form-control" name="row[template_name]" type="text"
                   value="">
        </div>
    </div>
    <div class="form-group row">
        <label class="control-label col-xs-12 col-sm-2">{:__('属性')}:</label>
        <div class="col-xs-12 col-sm-8">
            <dl class="fieldlist" data-template="tpl" data-name="row[template_json]">
                <dd>
                    <ins>{:__('标题')}</ins>
                    <ins>{:__('值')}</ins>
                </dd>
                <dd><a href="javascript:;" class="btn btn-sm btn-success btn-append"><i class="fa fa-plus"></i>
                    {:__('Append')}</a></dd>
                <!--请注意 dd和textarea间不能存在其它任何元素，实际开发中textarea应该添加个hidden进行隐藏-->
                <textarea name="row[template_json]" class="form-control " cols="30" rows="5"></textarea>
            </dl>
            <script id="tpl" type="text/html">
                <dd class="form-inline">
                    <ins >
                        <input type="text" name="<%=name%>[<%=index%>][title]" class="form-control"
                               value="<%=row.title%>" placeholder="标题" size="10"/>
                    </ins>
                    <ins style="width: calc(100% - 187px)">
                        <input type="text" name="<%=name%>[<%=index%>][value]" class="form-control"
                               value="" placeholder="值，选项使用“|”隔开" style="width: 100%"/>
                    </ins>
                    <!--下面的两个按钮务必保留-->
                    <span class="btn btn-sm btn-danger btn-remove"><i class="fa fa-times"></i></span>
                    <span class="btn btn-sm btn-primary btn-dragsort"><i class="fa fa-arrows"></i></span>
                </dd>
            </script>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
        <div class="col-xs-12 col-sm-8">
            <div class="radio">
                {foreach name="statusList" item="vo"}
                <label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio"
                                                       value="{$key}" {in name="key" value="1" }checked{/in} />
                    {$vo}</label>
                {/foreach}
            </div>
        </div>
    </div>
    <div class="form-group">
        <label class="control-label col-xs-12 col-sm-2">{:__('Weigh')}:</label>
        <div class="col-xs-12 col-sm-8">
            <input id="c-weigh" data-rule="required" class="form-control" name="row[weigh]" type="number" value="0">
        </div>
    </div>
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>
